package com.dmpp.mes.service.impl;


import com.dmpp.mes.bean.RespEnum;
import com.dmpp.mes.bean.ResponseData;
import com.dmpp.mes.dao.AromaMapper;
import com.dmpp.mes.dao.OrderBomMapper;
import com.dmpp.mes.parameterInfo.Aroma;
import com.dmpp.mes.parameterInfo.OrderBom;
import com.dmpp.mes.service.AromaService;
import com.dmpp.mes.service.OrderBomService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "OrderBomService")

public class OrderBomServiceImpl implements OrderBomService {

    @Autowired
    private OrderBomMapper mapper;

    @Override
    public ResponseData findAll(OrderBom orderBom) {
        ResponseData responseData = new ResponseData();
        PageInfo pageInfo = new PageInfo<>(mapper.findAll(orderBom));
        responseData.setData(pageInfo);
        return responseData;
    }

    @Override
    public ResponseData findByCode(OrderBom orderBom) {
        ResponseData responseData = new ResponseData();
        responseData.setData(mapper.findByCode(orderBom));
        return responseData;
    }

    @Override
    public ResponseData insert(OrderBom orderBom) {
        ResponseData responseData = new ResponseData();
        mapper.insert(orderBom);
        return responseData;
    }

    @Override
    public ResponseData update(OrderBom orderBom) {
        ResponseData responseData = new ResponseData();
        mapper.update(orderBom);
        return responseData;
    }

    @Override
    public ResponseData delete(OrderBom orderBom) {
        ResponseData responseData = new ResponseData();
        mapper.delete(orderBom);
        return responseData;
    }
}
